<?php
	
	/**
	 * undocumented class
	 *
	 * @package default
	 * @author Brian Bal
	 **/
	class ModelGenerator Extends BaseGenerator
	{
		
		public function generate($params)
		{
			//print_r($params);
			
			if(isset($params[2]))
			{
				$this->model_name = $params[2];
			}else{
				printUsage();
				exit();
			}
			
			// generate the model file
			$this->model_name = ucfirst($this->model_name);
			$this->table_name = uncamelize($this->model_name);
			$this->human_name = humanize($this->table_name);
			$filename = PROJECT_DIR . "app/models/$this->table_name.php";
			$model_content = $this->renderFile(PROJECT_DIR . "scripts/generators/Model/templates/model.php");
			$this->writeFile($filename, $model_content);
		}
		
	} // END class
	